#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>

int main()
{
    long long n = 0;
    long long arr[20] = { 0 };
    scanf("%lld", &n);
    int count = 0;
    long long num = n;
    while (num != 0)
    {
        num /= 10;
        count++;
    }
    int count2 = count - 3;
    long long i = 10;
    int j = 1;
    int sz = 0;
    int some = 0;
    int m = 0;
    for (i = 1; i < count; i++)
    {
        if (n / pow(10, i) >= 100 && n / pow(10, i) < 1000)
        {
            arr[j] = n / pow(10, i);
            some = arr[j];
            for (m = 1; m <= count2; m++)
            {
                some *= 10;
            }
            n = n - some;
            count2 -= 3;
            sz++;
            j++;
        }
    }
    arr[j] = n;
    for (int k = 1; k <= sz; k++)
    {
        if (k % 3 != 0)
        {
            printf("%lld", arr[k]);
        }
        else
        {
            printf(",");
        }
    }
    return 0;
}